﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
    Loaded="ChatM_Loaded"
	x:Class="C7.ChatModule"
	x:Name="ChatM"
	d:DesignWidth="1900" d:DesignHeight="880" FontFamily="/C7;Component/Resources/Fonts/#Zegoe UI Semi Bold - U" FontSize="26.667">
    <UserControl.Resources>
        <Storyboard x:Key="sbCloseGlow">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbrevCloseGlow">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="-35,0,0,0"/>
            </ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbOKGlow"/>
        <Storyboard x:Key="sbrevOKGlow"/>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="spClose">
            <BeginStoryboard Storyboard="{StaticResource sbCloseGlow}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="spClose">
            <BeginStoryboard x:Name="sbrevCloseGlow_BeginStoryboard" Storyboard="{StaticResource sbrevCloseGlow}"/>
        </EventTrigger>
    </UserControl.Triggers>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="0.03*"/>
            <RowDefinition Height="0.15*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="0.03*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.091*"/>
            <ColumnDefinition Width="0.9*"/>
            <ColumnDefinition Width="0.096*"/>
        </Grid.ColumnDefinitions>
        <StackPanel x:Name="spUpperControls" Margin="0,-32,0,0" VerticalAlignment="Top" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <StackPanel x:Name="spClose" HorizontalAlignment="Center" Orientation="Horizontal" d:LayoutOverrides="GridBox">
                <Image x:Name="imgClose" HorizontalAlignment="Left" VerticalAlignment="Top" Source="/C7;Component/Resources/Graphics/Icons/close.png" Height="{Binding ActualHeight, ElementName=lblClose, Mode=Default}"/>
                <Label x:Name="lblClose" Content="Close" FontFamily="/C7;Component/Resources/Fonts/#Avian" Foreground="White" VerticalAlignment="Center" Opacity="0" Margin="-33,0,0,0" FontSize="12"/>
            </StackPanel>
        </StackPanel>
        <Rectangle x:Name="rectBaseColor" StrokeThickness="2" Grid.ColumnSpan="3" Grid.RowSpan="4" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" OpacityMask="#5A000000"/>
        <Rectangle x:Name="rectBase" StrokeThickness="19" Grid.ColumnSpan="3" Grid.RowSpan="4">
            <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="0.025,0.5" StartPoint="0.973,0.504">
                    <GradientStop Color="#66000000"/>
                    <GradientStop Color="#66000000" Offset="1"/>
                    <GradientStop Color="Black" Offset="0.04"/>
                    <GradientStop Color="Black" Offset="0.96"/>
                </LinearGradientBrush>
            </Rectangle.OpacityMask>
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Gray" Offset="1"/>
                    <GradientStop Color="White"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Rectangle x:Name="rectBaseGradiant" StrokeThickness="19" Grid.ColumnSpan="3" Grid.RowSpan="4">
            <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="0.025,0.5" StartPoint="0.973,0.504">
                    <GradientStop Color="#66000000"/>
                    <GradientStop Color="#66000000" Offset="1"/>
                    <GradientStop Color="Black" Offset="0.04"/>
                    <GradientStop Color="Black" Offset="0.96"/>
                </LinearGradientBrush>
            </Rectangle.OpacityMask>
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.02,0.5" StartPoint="0.973,0.5">
                    <GradientStop Offset="1"/>
                    <GradientStop/>
                    <GradientStop Color="White" Offset="0.5"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Grid x:Name="grdHeader" Margin="0,0,0,-0.001" Grid.Column="1" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="0.4*"/>
                <RowDefinition Height="3*"/>
            </Grid.RowDefinitions>
            <Rectangle x:Name="rectHeader" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=tbTitle, Mode=Default}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{DynamicResource mtChatColor}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Rectangle x:Name="rectHeaderGradiant" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=tbTitle, Mode=Default}" OpacityMask="#85000000">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.044,0.616" StartPoint="0.968,0.51" MappingMode="RelativeToBoundingBox">
                        <GradientStop Color="Black"/>
                        <GradientStop Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <TextBlock x:Name="tbTitle" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1" FontFamily="/C7;Component/Resources/Fonts/#Zegoe Caps" FontSize="48" Text="{DynamicResource mtChatTitle}" d:LayoutOverrides="HorizontalAlignment, GridBox"/>
        </Grid>
        <DockPanel x:Name="dpTinyStuff" Grid.ColumnSpan="3" Grid.RowSpan="4" LastChildFill="False" d:IsHidden="True">
            <Rectangle x:Name="rectTinyLeft" OpacityMask="#7F000000" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" Width="1" DockPanel.Dock="Right"/>
            <Rectangle x:Name="rectTinyLower" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" DockPanel.Dock="Bottom" OpacityMask="#7F000000" Height="1"/>
        </DockPanel>
        <Grid x:Name="Contents" Grid.Column="1" Grid.Row="2">
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition Width="0.957*"/>
        		<ColumnDefinition Width="0.043*"/>
        	</Grid.ColumnDefinitions>
        	<Grid.RowDefinitions>
        		<RowDefinition Height="0.909*"/>
        		<RowDefinition Height="0.091*"/>
        	</Grid.RowDefinitions>
        	<ListBox x:Name="tbChat" Grid.ColumnSpan="2" Background="{x:Null}" ItemTemplate="{DynamicResource dtChat}" BorderBrush="{x:Null}">
        		<ListBox.Resources>
        			<DataTemplate x:Key="dtChat">
        				<StackPanel Orientation="Horizontal">
        					<TextBlock  Text="{Binding name}" TextWrapping="Wrap" FontFamily="/C7;Component/Resources/Fonts/#Zegoe Caps" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        					<TextBlock Text="{Binding message}" FontFamily="/C7;Component/Resources/Fonts/#Zegoe UI - U" FontSize="32" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="24,0,0,0"/>
        				</StackPanel>
        			</DataTemplate>
        		</ListBox.Resources>
        	</ListBox>
        	<TextBox x:Name="tbWrittenText" Text="Enter what you want to say" TextWrapping="Wrap" Grid.Row="1" KeyUp="tbWrittenText_KeyUp"/>
        	<Image x:Name="imgSend" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Column="1" Grid.Row="1" Source="/C7;Component/Resources/Graphics/Icons/sendInverted.png" d:LayoutOverrides="VerticalAlignment" MouseLeftButtonDown="btnSend_Click"/>
        </Grid>
    </Grid>
</UserControl>